<?php
html::printPath(array(
		'seminar.form-title' => 'admin/seminar/all',
		$registration['seminar']['name'] => '/admin/seminar/display?id=' . $registration['seminar']['id'],
		'seminar.registrationOverview' => 'admin/registration/listing?seminar_id=' . $registration['seminar']['id'],
		text::get('registration-registrationWithNumber', $registration['id']) => '/admin/registration/display?id=' . $registration['id'],
		'registration.edit-title' => ''
));
$msg->printMessages();

if ($paymentAcceptance['confirmed_at']) {
	echo '<p class="warningNote">' . text::getEscaped('registration-alreadyConfirmedWarning') . '</p>';
}

$isKarmayoga = $registration['category']['program_type']['code'] == constants::$programTypeCodeKarmayoga;

$fb = new FormBuilder('registration', $registration);
$fb->setAction('/admin/registration/save');
$fb->display('person_id')->value(format::personFullName($registration['person']));
$fb->display('seminar_id')->value($registration['seminar']['name']);
$fb->display('batch_type_code')->labelKey('seminarBatch.batch_type_code')->value($registration['batch']['batch_type']['name']);
$fb->comboBox('batch_code', $batchOptions)->required()->noEmptyOption();
$fb->comboBox('category_code', $categoryOptions)->required()->noEmptyOption();
$fb->price('total_price', $registration['price_group']['currency_code'])->readOnly();
$fb->price('price_paid', $registration['price_group']['currency_code']);
$fb->price('extra_discount', $registration['price_group']['currency_code'])->rendered($registration['extra_discount']);
$fb->textarea('extra_discount_reason')->rendered($registration['extra_discount']);
$fb->display('payment_on_arrival_fee')->rendered($registration['payment_on_arrival_fee']);
$fb->display('cancellation_fee')->rendered($registration['cancelled_at']);
$fb->yesNoBox('social_discount_applied')->hint()->noEmptyOption()->required()->rendered($registration['social_discount']);
$fb->yesNoBox('early_discount_applied')->noEmptyOption()->required()->rendered($registration['early_discount']);
$fb->yesNoBox('late_charge_applied')->noEmptyOption()->required()->rendered($registration['late_charge']);
$fb->display('payment_organization_id')->value($registration['payment_organization']['name']);
$fb->display('payment_type')->value(text::get('registration-paymentType-' . $registration['payment_type'])); 
$fb->comboBox('exercise_group_code', $exerciseGroupOptions)->rendered($exerciseGroupOptions);
$fb->comboBox('preferred_karmayoga_type_code', $karmayogaOptions)->rendered($isKarmayoga);
$fb->comboBox('assigned_karmayoga_type_code', $karmayogaOptions)->rendered($isKarmayoga);
$fb->timestamp('cancelled_at')->readOnly()->rendered($registration['cancelled_at']);
$fb->display('cancelled_by_id')->value(format::personFullName($registration['cancelled_by']))->rendered($registration['cancelled_at']);
$fb->textarea('cancellation_reason')->readOnly()->rendered($registration['cancelled_at']);
$fb->timestamp('confirmed_at')->readOnly()->rendered($registration['confirmed_at']);
$fb->display('confirmed_by_id')->value(format::personFullName($registration['confirmed_by']))->rendered($registration['confirmed_at']);
$fb->textarea('org_notes')->readOnly();
$fb->textarea('program_notes')->readOnly();
$fb->textarea('payment_notes')->readOnly();
// $fb->display('room_code')->value($registration['room']['name']);
// $fb->yesNoBox('is_present')->readOnly();
$fb->submitButton();
$fb->write();
